const { sequelize } = require('./init')
const SEQ_PARAMETER = {
  timestamps: false,
  freezeTableName: true
}

const sys_dept = sequelize.define(
  require('./models_type/sys_dept').NAME,
  require('./models_type/sys_dept').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_menu = sequelize.define(
  require('./models_type/sys_menu').NAME,
  require('./models_type/sys_menu').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_post = sequelize.define(
  require('./models_type/sys_post').NAME,
  require('./models_type/sys_post').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_role_dept = sequelize.define(
  require('./models_type/sys_role_dept').NAME,
  require('./models_type/sys_role_dept').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_role_menu = sequelize.define(
  require('./models_type/sys_role_menu').NAME,
  require('./models_type/sys_role_menu').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_role = sequelize.define(
  require('./models_type/sys_role').NAME,
  require('./models_type/sys_role').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_user_post = sequelize.define(
  require('./models_type/sys_user_post').NAME,
  require('./models_type/sys_user_post').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_user_role = sequelize.define(
  require('./models_type/sys_user_role').NAME,
  require('./models_type/sys_user_role').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_user = sequelize.define(
  require('./models_type/sys_user').NAME,
  require('./models_type/sys_user').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_dict_type = sequelize.define(
  require('./models_type/sys_dict_type').NAME,
  require('./models_type/sys_dict_type').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_dict_data = sequelize.define(
  require('./models_type/sys_dict_data').NAME,
  require('./models_type/sys_dict_data').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const sys_logininfor = sequelize.define(
  require('./models_type/sys_logininfor').NAME,
  require('./models_type/sys_logininfor').TABLE,
  {
    ...SEQ_PARAMETER,
    initialAutoIncrement: 100000
  },
)

const _define = {
  sys_dept,
  sys_menu,
  sys_post,
  sys_role_dept,
  sys_role_menu,
  sys_role,
  sys_user_post,
  sys_user_role,
  sys_user,
  sys_dict_type,
  sys_dict_data,
  sys_logininfor,
}

module.exports = {
  ..._define,
  sequelize
}
